<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh-CN">
<head>
<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">

			<title>rbac-周边零食</title>


			<link rel="stylesheet"
				href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">

				<link rel="stylesheet" href="./rbac/css/app.css">

					<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
					<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
					<!--[if lt IE 9]>
	  <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	  <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
</head>
<body>

	<!--导航条-->
	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<a class="navbar-brand" href="adminLogin!login.action">rbac-周边零食</a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse">
			<ul class="nav navbar-nav">
				<li class="active"><a href="adminLogin!login.action">首页</a></li>
			</ul>

			<p class="navbar-text navbar-right">
				欢迎进入，<%
				out.print(session.getValue("name"));
			%>
			</p>

		</div>
	</div>
	</nav>

	<!--菜单栏和内容区域-->
	<div class="container-fluid">
		<div class="col-sm-2 col-md-2 col-lg-2 sidebar">
			<ul class="nav nav-sidebar">
				<li>数据表管理</li>
				<li><a href="userList!userList.action?page=1">用户列表</a></li>
				<li><a href="categoryList!categoryList.action">商品列表</a></li>
				<li><a href="productList!productList.action?page=1">产品列表</a></li>
				<li><a href="orderList!orderList.action?page=1">订单列表</a></li>
			</ul>
		</div>
		<div
			class="col-sm-10 col-sm-offset-2 col-md-10  col-md-offset-2 col-lg-10 col-lg-offset-2 main">

			<div class="table-responsive">
				<div class="col-md-6">
					<span>${message}</span>
				</div>
				<div class="col-md-6" style="text-align: right">
					<a href="productDetail!productDetail.action?productid=0">添加</a>
				</div>
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>分类</th>
							<th>名称</th>
							<th>描述</th>
							<th>库存量</th>
							<th>单价</th>
							<th>封面</th>
							<th>是否促销</th>
							<th>促销价钱</th>
							<th>是否热卖</th>
							<th>是否上架</th>
							<th>是否推荐</th>
							<th>更新时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<s:if test="%{listProduct != null}">
							<s:iterator value="listProduct">
								<tr>
									<td><s:property value="shopCategory.cateid" /></td>
									<td><s:property value="title" /></td>
									<td><s:property value="descr" /></td>
									<td><s:property value="num" /></td>
									<td><s:property value="price" /></td>
									<td><img src="<s:property value="cover"/>" style="width:100px;height:100px;"/></td>
									<td><s:property value="issale" /></td>
									<td><s:property value="saleprice" /></td>
									<td><s:property value="ishot" /></td>
									<td><s:property value="ison" /></td>
									<td><s:property value="istui" /></td>
									<td><s:property value="updatetime" /></td>
									<td>
									   <a href="productDel!productDel.action?productid=<s:property value="productid"/>&page=<s:property
                            value="page" />">删除</a>
										| 
										<a href="productDetail!productDetail.action?productid=<s:property value="productid"/>">编辑</a>
									</td>
								</tr>
							</s:iterator>
						</s:if>
						<s:else>
							<tr>
								<td colspan="3">暂无数组</td>
							</tr>
						</s:else>
					</tbody>
				</table>
			</div>

			<s:iterator value="pageProductBean">
				<tr>
					<td colspan="6" align="center" bgcolor="#5BA8DE">共<s:property
							value="allRow" />条记录 共<s:property value="totalPage" />页 当前第<s:property
							value="currentPage" />页
							<a href="productList!productList.action?page=<s:property value="%{currentPage}"/>">刷新</a>
							<br> 
							<s:if test="%{currentPage == 1}">    
                                                                                        第一页  上一页    
                            </s:if> 
                            <s:else>
								<a href="productList!productList.action?page=1">第一页</a>
								<a
									href="productList!productList.action?page=<s:property value="%{currentPage-1}"/>">上一页</a>
							</s:else> <s:if test="%{currentPage != totalPage}">
								<a
									href="productList!productList.action?page=<s:property value="%{currentPage+1}"/>">下一页</a>
								<a
									href="productList!productList.action?page=<s:property value="totalPage"/>">最后一页</a>
							</s:if> 
							<s:else>    
							         下一页  最后一页    
							</s:else>
					</td>
				</tr>
			</s:iterator>
		</div>
	</div>

	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<script
		src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>